package cn.uin.domain.auth.service.user.register.factory;

import cn.uin.domain.auth.service.user.register.IRegisterStrategyService;

import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @ClassName RegisterStrategyFactory
 * @Description:用户注册工厂类
 * @Author: Administrator
 * @CreateDate: 2025/10/22 10:07
 * @Version: 1.0
 */
public class RegisterStrategyFactory {

	public static Map<String, IRegisterStrategyService> map = new ConcurrentHashMap<>(8);

	/**
	 * 添加策略
	 * @param key
	 * @param iDiscountCalculateService
	 */
	public static void addStrategy(String key, IRegisterStrategyService iDiscountCalculateService) {
		map.put(key, iDiscountCalculateService);
	}

	/**
	 * 获取策略
	 * @param key
	 * @return
	 */
	public static IRegisterStrategyService get(String key) {
		return map.get(key);
	}

	/**
	 * 获取所有策略
	 * @return
	 */
	public static Set<String> getAll() {
		return map.keySet();
	}

}
